/**
 * @ClassName Demo03
 * @Description TODO
 * @Author Li
 * @Date 2022/8/14 15:05
 * @ModifyDate 2022/8/14 15:05
 * @Version 1.0
 */
public class Demo03 {
    public static void log(int level, MessageBuilder mb) {
        if (level == 1) {
            System.out.println(mb.buildMessage());
        }
    }

    public static void main(String[] args) {
        String msgA = "Hello";
        String msgB = "World";
        String msgC = "Java";
        log(2, () -> {
            System.out.println("Lambda执行！");
            return msgA + msgB + msgC;
        });
    }
}
